package com.hrbxlh.virtualization.service;

import com.hrbxlh.virtualization.param.ClipboardParam;
import com.hrbxlh.virtualization.param.DesktopShareParam;
import com.hrbxlh.virtualization.vo.DesktopVO;
import com.hrbxlh.virtualization.vo.UserListVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;


/**
 * @author cheer
 */
public interface DesktopService {

    /**
     * 获取实验桌面访问地址
     *
     * @param stuorteaId 用户Id
     * @param courseId   课程Id
     * @param chapterId  章节Id
     */
    DesktopVO queryDesktop(String stuorteaId, Integer courseId, Integer chapterId);

    /**
     * 替换桌面
     *
     * @param stuorteaId 用户Id
     * @param courseId   课程Id
     * @param chapterId  章节Id
     */
    DesktopVO replaceDesktop(String stuorteaId, Integer courseId, Integer chapterId);

    /**
     * 下载文件
     *
     * @param stuorteaId 用户Id
     * @param courseId   课程Id
     * @param chapterId  章节Id
     */
    void downloadFile(String stuorteaId, Integer courseId, Integer chapterId);

    /**
     * 剪贴板
     */
    void clipboard(ClipboardParam clipboardParam);

    /**
     * 上传
     */
    void upload(Long  containerId,MultipartFile file) throws IOException;
    /**
     * 查询在线用户
     */
    UserListVO listOnlineUsers(Integer courseId, Integer chapterId, String stuorteaId);

    /**
     * 分享实验环境
     *
     * @param stuorteaId 发起分享的用户Id
     */
    void shareContainer(DesktopShareParam desktopShareParam, String stuorteaId);

    /**
     * 关闭分享实验环境
     *
     * @param containerId 容器Id
     * @param stuorteaId  关闭分享的用户Id
     */
    void unshareContainer(Long containerId, String stuorteaId);

    String ftp(Long containerId);

    boolean isFileExists(String stuorteaId, Integer courseId, Integer chapterId);
}
